package eleanor.ltd.isne.components;

import java.util.Date;

import org.apache.tapestry5.Asset;
import org.apache.tapestry5.BindingConstants;
import org.apache.tapestry5.Block;
import org.apache.tapestry5.ComponentResources;
import org.apache.tapestry5.SymbolConstants;
import org.apache.tapestry5.annotations.Environmental;
import org.apache.tapestry5.annotations.Import;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.Path;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.annotations.SetupRender;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.ioc.annotations.Symbol;
import org.apache.tapestry5.services.javascript.JavaScriptSupport;

@Import(stylesheet={"context:template/css/style.css", "context:template/css/light/theme.css"}, library={"context:template/js/jquery-1.6.4.min.js","context:template/js/jquery-ui.js", "context:template/js/functions.js", "context:template/js/plugins.js",
		"context:template/js/editor.js", "context:template/js/calendar.js", "context:template/js/flot.js", "context:template/js/elfinder.js"
		, "context:template/js/datatables.js", "context:template/js/wl_Alert.js", "context:template/js/wl_Autocomplete.js", "context:template/js/wl_Breadcrumb.js"
		, "context:template/js/wl_Calendar.js", "context:template/js/wl_Chart.js", "context:template/js/wl_Color.js", "context:template/js/wl_Date.js"
		, "context:template/js/wl_Editor.js", "context:template/js/wl_File.js", "context:template/js/wl_Dialog.js", "context:template/js/wl_Fileexplorer.js"
		, "context:template/js/wl_Form.js", "context:template/js/wl_Gallery.js", "context:template/js/wl_Multiselect.js", "context:template/js/wl_Number.js"
		, "context:template/js/wl_Password.js", "context:template/js/wl_Slider.js", "context:template/js/wl_Store.js", "context:template/js/wl_Time.js"
		, "context:template/js/wl_Valid.js", "context:template/js/wl_Widget.js", "context:template/js/config.js", "context:template/js/script.js"})
public class Template {

	
	@Property
    @Parameter(required = true, defaultPrefix = BindingConstants.LITERAL)
    private String title;

	@Property
    @Parameter(defaultPrefix = BindingConstants.LITERAL)
    private Block afterName;
	
    @Property
    private String pageName;
    
    @Property
    @Parameter(defaultPrefix = BindingConstants.LITERAL)
    private String sidebarTitle;

    @Property
    @Parameter(defaultPrefix = BindingConstants.LITERAL)
    private Block sidebar;

    @Inject
    private ComponentResources resources;

    @Property
    @Inject
    @Symbol(SymbolConstants.APPLICATION_VERSION)
    private String appVersion;


    public String getClassForPageName()
    {
        return resources.getPageName().equalsIgnoreCase(pageName)
                ? "current_page_item"
                : null;
    }

    public String[] getPageNames()
    {
        return new String[]{"Index", "About", "Contact"};
    }
    
    public Date getCurrentTime()
    {
        return new Date();
    }
    
     
}
